<script setup>
import { useStore } from 'vuex'
const store = useStore()
console.log('store', store);

const add = () => {
    store.commit('addMoney')
}
const addPayload = (num) => {
    store.commit('addMoneyPayload', num)
}
const addAsync = () => {
    store.dispatch('addMoneyAsync')
}
</script>

<template>
    <h1>Hello vue3</h1>
    <div>{{ store.state.money }}</div>
    <div>{{ store.getters.double }}</div>
    <button @click="add">同步加钱</button>
    <button @click="addPayload(10000)">同步加钱带参数</button>
    <button @click="addAsync">异步加钱</button>
</template>
